﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HtmlAgilityPack;

namespace Blue.Spider.Core.Entities
{
    public class DetailPageBase
    {
        public string Title;
        public string DetailUrl;
        public string ImageUrl;

        public void Load(HtmlNode itemNode)
        {
            this.Title = itemNode.Elements("div").Where(i => i.Attributes["class"].Value.Contains("aviso-description")).Single().Element("h3").Element("a").InnerText;
            this.DetailUrl = itemNode.Elements("div").Where(i => i.Attributes["class"].Value.Contains("aviso-description")).Single().Element("h3").Element("a").Attributes["href"].Value;
        }
    }
}
